Subject: Statvisual Demonstration in PROMOVI
Statistician Wenfei Zhang
Latest updated date: 2020-01-15
wk_dir <- "K:/Biostats/AVI-4658/4658-301/team meeting/EC_analysis"
dat_dir <- paste0(wk_dir, "/Data/")
## load data 301 data
adeff = read.csv(paste0(dat_dir, "csr.csv"))
adeff = dplyr::filter(adeff, (ANL01FL %in% "Y" | ABLFL %in% "Y") & TRT01A %in% "Eteplirsen 30 mg/kg")
## load baseline 301 data
adsl = read.csv(paste0(dat_dir, "adsl.csv")) %>% dplyr::filter(SUBJID %in% adeff$SUBJID)
## load NSAA 301 data
nsaa_301 <- read.csv(paste0(dat_dir, "adrs_301.csv")) %>% filter((ANL01FL == "Y" |
ABLFL == "Y") & TRT01A == "Eteplirsen 30 mg/kg" & SUBJID %in% adeff$SUBJID &
PARAMCD %in% c("NSAA118"))
## get LOA status
LOA = read.csv(paste0(dat_dir, "adtte_301.csv")) %>% filter(paramcd == "TTLOA" &
cnsr == 0)
# merge NSAA
nsaa_6mwt <- inner_join(mutate(adeff, Sixmwt = AVAL) %>% select(SUBJID, Sixmwt, AVISIT),
mutate(nsaa_301, nsaa = AVAL) %>% select(SUBJID, nsaa, AVISIT), by = c("SUBJID",
"AVISIT"))
Indiviudal longitudinal trajectories
# ggplotly(LinePlot( data = adeff, x = 'AVISITN', y = 'AVAL', sid = 'ID', group =
# 'LOA', facet.nrow= 1, title ='6MWT',xlab ='weeks'), tooltip = c('sid','y'))
Boxplot with scatter points across time
ggplotly(Box(data = adeff, x = "AVISITN", y = "AVAL", group = "LOA", title = "6MWT",
dodge.width = 0.4, xlab = "weeks"))
Baseline charateristics among/between groups
ggplotly(Box(data = adsl, x = "LOA", y = "BLNSAA", group = "STUDYID", dodge.width = 0,
jitter.width = 0.1, line = NULL))
Baseline charateristics for predicting outcome
BoxROC(data = adsl, group.var = "LOA", y = "BLNSAA", point.size = 1)
## TableGrob (1 x 1) "arrange": 1 grobs
## z cells name grob
## 1 1 (1-1,1-1) arrange gtable[arrange]
Correlation matrix:
base_v = c("BLSMWT", "BLNSAA", "BLRISETM", "BLRUNTM", "BL4STTM", "BLHT", "BLWT",
"AGE") #,'DMDDUR', 'CRTDUR' )
base_cor = cor(adsl[, base_v])
ggcorrplot(base_cor, hc.order = TRUE, type = "lower", lab = TRUE)
Scatter plot:
ggplotly(XYscatter(data = nsaa_6mwt, x = "Sixmwt", y = "nsaa", group = "AVISIT",
facet.nrow = 2))
Bi-axis Error bar plot:
BiAxisErrBar( dat= nsaa_6mwt, group = "AVISIT",
y.left = "Sixmwt", y.right = "nsaa")